package com
{
	import flash.events.MouseEvent;
	
	import mx.containers.HBox;
	import mx.containers.VBox;
	import mx.controls.Button;
	import mx.controls.Label;
	
	import mx.containers.TitleWindow;
	import mx.managers.PopUpManager;
	
	public class camSelect extends VBox
	{
		private var lb:Label = new Label();
		private var inbox:HBox = new HBox();
		private var main:Button = new Button();
		private var sub:Button = new Button();
		public function camSelect()
		{
			this.width = 150;
			this.height = 100;
		    this.setStyle("horizontalAlign","center");
		    this.setStyle("verticalAlign","middle");
		    this.setStyle("verticalGap",7);
		    this.setStyle("backgroundColor","white");
		    this.setStyle("backgroundAlpha",0.1);
		    this.setStyle("cornerRadius",10);
		    this.setStyle("borderStyle","solid");
		    this.setStyle("paddingTop",7);
		    
		    lb.text = "Web CAM";
			lb.percentWidth = 100;
			lb.height = 20;
			lb.setStyle("color","white");
			lb.setStyle("textAlign","center");
						
			inbox.percentWidth = 100;
			inbox.height = 40; 
			inbox.setStyle("horizontalGap",4);
			inbox.setStyle("horizontalAlign","center");
		    inbox.setStyle("verticalAlign","middle");
			
			main.width = 65;
			main.height = 30;
			main.label = "본원";
			main.addEventListener(MouseEvent.CLICK, mainOpen);
						
			sub.width = 65;
			sub.height = 30;
			sub.label = "분원";
			sub.addEventListener(MouseEvent.CLICK, subOpen);
												
			inbox.addChild(main);
			inbox.addChild(sub);
			this.addChild(lb);
			this.addChild(inbox);
		}
		private function mainOpen(e:MouseEvent){
			var popMainT:mainCam=mainCam(PopUpManager.createPopUp(this, mainCam, true));
			popMainT.width = stage.width;
			popMainT.height = stage.height;
		}
		private function subOpen(e:MouseEvent){
			var popSubT:subCam=subCam(PopUpManager.createPopUp(this, subCam, true));
			popSubT.width = stage.width;
			popSubT.height = stage.height;
		}
		

	}
}